package com.springbooti18n.model;

import com.springbooti18n.validator.DateBefor;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;
import java.util.Date;

/**
 * xufan
 * 2019/1/4
 */
//@DateCompare
public class User {
//    如果不加message则让系统自定去加载默认的
//    默认的根据系统当前语言环境选择加载
//    默认的语言配置环境在 hibernate-validator JAR下面的 ValidationMessages
    @Min(value = 0)
    long userId ;

    @NotEmpty(message="{User.userName}")
    String userName;

    String sex;
    @Min(value = 0)
    int age;

 @DateBefor(getDate="XXXXXOOOOOOOO" )
    Date startTime;

    Date endTime;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }


}
